package com.cskaoyan.service.impl;

import com.cskaoyan.mapper.MarketGoodsSpecificationMapper;
import com.cskaoyan.model.MarketGoodsSpecification;
import com.cskaoyan.service.GoodsSpecificationService;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class GoodsSpecificationServiceImpl implements GoodsSpecificationService {
    @Override
    public void create(SqlSession sqlSession, List<MarketGoodsSpecification> specifications, Integer goodsId) {
        MarketGoodsSpecificationMapper specificationMapper = sqlSession.getMapper(MarketGoodsSpecificationMapper.class);
        for (MarketGoodsSpecification specification : specifications) {
            specification.setGoodsId(goodsId);
            specificationMapper.insertSelective(specification);
        }
    }
}
